Add maintenance.py tool with fixed templates and comprehensive documentation#2
Add maintenance.py tool with fixed templates and comprehensive documentation#2
Conversation
Co-authored-by: ShaddGallegos <7536008+ShaddGallegos@users.noreply.github.com>
Co-authored-by: ShaddGallegos <7536008+ShaddGallegos@users.noreply.github.com>
|
@copilot 2026-02-25 09:25:05.786 [info] Python-envs extension version: 1.20.1 2026-02-25 09:29:38.529 [error] Error running pip list Failed to run python -m pip list 2026-02-25 09:29:49.652 [error] Error running pip list Failed to run python -m pip list 2026-02-25 09:30:14.372 [error] Error running pip list Failed to run python -m pip list |
|
@copilot prevent the use of icons or emoji in all projects, roles, playbooks, markdown, or anything else |
Co-authored-by: ShaddGallegos <7536008+ShaddGallegos@users.noreply.github.com>
Done in commit
|
Original prompt
please clean this up
/dev/mapper/rhel-root",
"is_lvm": true,
"vg_name": "rhel",
"lv_name": "root"
}'
echo -e "\n\nTest completed"
""",
Test email notifications
echo "Testing email notification configuration..."
ansible localhost -m community.general.mail -a "\
host=${SMTP_HOST:-localhost} \
port=${SMTP_PORT:-25} \
to=${TEST_EMAIL:-admin@example.com} \
subject='LVM Automation Test Email' \
body='This is a test email from the LVM automation system.'"
echo "Test email sent"
""",
Setup monitoring cron job
set -e
WEBHOOK_URL="${WEBHOOK_URL:-http://eda-controller:5000/webhook}"
echo "Setting up disk monitoring cron job..."
cat > /usr/local/bin/lvm-disk-monitor.sh << 'EOF'
#!/bin/bash
WEBHOOK_URL="$WEBHOOK_URL"
HOSTNAME="$(hostname)"
df -h | grep -E '^/dev/' | while read line; do
USAGE=$(echo $line | awk '{print $5}' | tr -d '%')
MOUNT=$(echo $line | awk '{print $6}')
DEVICE=$(echo $line | awk '{print $1}')
done
EOF
chmod +x /usr/local/bin/lvm-disk-monitor.sh
(crontab -l 2>/dev/null; echo "*/5 * * * * /usr/local/bin/lvm-disk-monitor.sh") | crontab -
echo "Monitoring cron job installed"
"""
}
galaxy_info:
author: System Administrator
description: {name.replace('',' ').title()}
license: MIT
min_ansible_version: 2.9
platforms: [{name: EL, versions: [8,9]}]
dependencies: []\n""")
(rp / "README.md").write_text(f"""# {name.replace('',' ').title()}
Description
Handles {name.replace('_',' ')}.
Requirements
Example